home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9218 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: lyra.csx.cam.ac.uk!news
  2. From: timc@chiark.chu.cam.ac.uk (Tim Cutts)
  3. Newsgroups: comp.lang.c++,comp.lang.c,comp.os.ms-windows.programmer.misc
  4. Subject: sscanf (was Re: Can 'fscanf' be used in 16-bit DLL?)
  5. Date: 29 Feb 1996 12:36:34 +0000 (GMT)
  6. Organization: Linux Unlimited
  7. Message-ID: <+oi*0Dwtm@myrddin.chu.cam.ac.uk>
  8. References: <DMrn2J.5F7.0.-s@hkusuc.hku.hk> <824322633snz@chrism.demon.co.uk>
  9. NNTP-Posting-Host: myrddin.chu.cam.ac.uk
  10. Originator: timc@chiark.chu.cam.ac.uk (UNIX:@[131.111.131.114])
  11.  
  12. In article <824322633snz@chrism.demon.co.uk>,
  13. Chris Marriott  <chris@chrism.demon.co.uk> wrote:
  14. >In article <DMrn2J.5F7.0.-s@hkusuc.hku.hk> h8817968@hkuxb.hku.hk "Daniel" writes:
  15. >
  16. >>I am trying to make a 16-bit DLL by using MSVC V1.51 but, when I 
  17. >>compile the program, it gives me the follwing warning:
  18. >>
  19. >>warning C4013: 'fscanf' undefined; assuming extern returning int
  20. >>
  21. >>As expected, the linking stage gives me the following:
  22. >>
  23. >>error L2029: '_fscanf' : unresolved external
  24. >>
  25. >>It seems that 'fscanf' cannot be used if you want to produce a  
  26. >>DLL.  Can anyone tell me whether my guess is true?  If no, what 
  27. >>should I do if I want to use 'fscanf'.  If yes, is there any 
  28. >>alternative function usable?
  29. >
  30. >One option is simply not to define "_WINDLL". I used to use "fscanf" in
  31. >DLLs and it appears to work OK.
  32.  
  33. This approach does not work for sscanf in VC++ 1.52.  It is not
  34. present in ldllcew.lib.  I tried extracting sscanf() and input() from
  35. llibcew.lib with LIB.EXE, and linking the obj files directly, but the
  36. result was a GPF when the sscanf() was called.
  37.  
  38. Has anyone written an sscanf() function that can be used in DLLs?  I
  39. can't think for the life of me why MS decided to exclude it.  In VC++
  40. 2.1, the RTL always has it (this DLL I'm writing works fine as a
  41. 32-bit DLL).
  42.  
  43. Tim.
  44.  
  45.